package jp.gr.java_conf.ryz.summarize.client;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.user.client.ui.ListBox;

public class ObjectListBox<T> extends ListBox
{
	private List<T> _items = new ArrayList<T>();
	
	@Override
	public void clear()
	{
		super.clear();
		_items.clear();
	}
	
	public void addItem(String itemName, T item)
	{
		addItem(itemName);
		_items.add(item);
	}
	
	public T getItem(int index)
	{
		return _items.get(index);
	}
	
	public T getSelectedItem()
	{
		return _items.get(getSelectedIndex());
	}
}
